//
//  YWDetectAndUpkeepDBManager.h
//  maintain
//
//  Created by kyo on 17/3/10.
//  Copyright © 2017年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWMission.h"

@class FMResultSet;
@class FMDatabase;

@interface YWDetectAndUpkeepDBManager : NSObject

/**
 *  创建检测保养任务表
 *
 *  @return 无
 */
+ (BOOL)createDetectAndUpkeepMissionTable;
/**
 *  重建检测保养任务表
 *
 *  @return 无
 */
+ (void)dropAndReCreateDetectAndUpkeepMissionTable;
/**
 *  创建检测保养任务的设备表
 *
 *  @return 无
 */
+ (BOOL)createDetectAndUpkeepMissionEquipmentTable;
/**
 *  更新检测保养设备
 *
 *  @return 无
 */
+ (BOOL)updateDetectAndUpkeepEqipments:(NSArray*)equipmentArray missionId:(NSInteger)missioId set:(FMResultSet*)set db:(FMDatabase*)db;

/**
 *  保存任务信息
 *
 *  @param missions 任务模型数组
 *
 *  @return 结果
 */
+ (BOOL)updateDetectAndUpkeepMissionWithArray:(NSArray*)missions;

/**
 *  获取任务（检测、保养）
 *
 *  @param status 任务状态
 *  @param maintenanceType 任务类型
 *
 *  @return 任务模型数组
 */
+ (NSArray*)detectAndUpkeepMissionWithStatus:(YWMissionFinishStatus)status maintenanceType:(YWMaintenanceType)type page:(NSInteger)page;

/**
 *  获取维保任务
 *
 *  @param missionId 任务Id
 *
 *  @return 任务模型
 */
+ (YWMaintenanceMission *)maintenanceMissionWithMissionId:(NSInteger)missionId;

/**
 *  获取任务
 *
 *  @return YWMaintenanceMission
 */
+ (YWMaintenanceMission*)maintenanceMissionWithFMResultSet:(FMResultSet*)set FMDatabase:(FMDatabase*)db;

/**
 *  获取未完成的检测保养任务id串
 *
 *  @return 数量
 */
+ (NSString*)allUnfinishDetectAndUpkeepMissionIds;

@end
